//
// Created by PC on 2023/12/28.
// 高精度除法 高精度/低精度
// OJ: https://www.luogu.com.cn/problem/P1480 通过
// OJ: https://oj.ilingxin.cn/p/1604 通过
// 讲解:https://www.bilibili.com/video/BV1Je4y1o7vR/?spm_id_from=333.337.search-card.all.click&vd_source=f69fe937b6744667b35fadd0fa06ddd2


#include <iostream>

using namespace std;


int main()
{
    string a = "301";
    long long b = 22; // 13
    a = "12345", b = 666; //18
    a = "12345678", b = 999; // 12358
    a = "123456789123", b = 99999; // 1234580
//    a = "3141592", b = 4;  // 785398
    a="0",b=99; // 0
    a = "9000000000",b=1000000000; // 9 需要long long
    cin >> a >> b;
    if (a=="0")
    {
        cout<<0;
        return 0;
    }
    long long left = 0;  // 余数
    bool zero =true;
    for (int i = 0; i < a.size(); ++i)
    {
        int cur = a[i] - '0'; //当前位的数
        long long num = left * 10 + cur;
        if (num < b)
        {
            left = num;
            if(!zero)
                cout << 0;
            continue;
        }
        zero=false;
        int shang = num / b;  // 商
        cout << shang;
        left = num % b;
    }
    return 0;
}